﻿#region Using Statements
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
#endregion

namespace GameBase.Graphics
{
    /// <summary>
    /// Describes a custom vertex format structure that contains only position data.
    /// </summary>
    public struct VertexPosition : IVertexType
    {
        /// <summary>
        /// XYZ position.
        /// </summary>
        public Vector3 Position;

        /// <summary>
        /// Vertex declaration, which defines per-vertex data.
        /// </summary>
        public readonly static VertexDeclaration VertexDeclaration = new VertexDeclaration
        (
            new VertexElement(0, VertexElementFormat.Vector3, VertexElementUsage.Position, 0)
        );

        /// <summary>
        /// Initializes a new instance of this struct.
        /// </summary>
        /// <param name="pos">The vertex position.</param>
        public VertexPosition(Vector3 pos)
        {
            Position = pos;
        }

        VertexDeclaration IVertexType.VertexDeclaration
        {
            get { return VertexDeclaration; }
        }
    }
}
